﻿using BLL;
using Models;
using Newtonsoft.Json;
using OSSUtility.BLL;
using OSSUtility.Models;
using Ozone.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ozone.BLL
{
    //高级参数
    public class AdvParamBLL
    {
        static public AdvParam get(string LineNum)
        {
            string FDataID = "AdvParam"+ LineNum;
            AdvParam model = null;
            ConfigParamBLL bll = new ConfigParamBLL();
            string FContent = bll.getContent(FDataID);

            if (string.IsNullOrEmpty(FContent))
            {
                model = new AdvParam();
            }
            else
            {
                model = JsonConvert.DeserializeObject<AdvParam>(FContent);

            }

            return model;
        }

        static public void save(AdvParam param, string LineNum)
        {
            string FDataID = "AdvParam" + LineNum;
            ConfigParamBLL bll = new ConfigParamBLL();
            bll.Save(FDataID, JsonConvert.SerializeObject(param));
        }
    }
}
